package com.cloud.screen.interfaces;

import com.cloud.screen.api.entity.ScreenReqInfo;
import com.cloud.screen.common.config.FeignConfiguration;
import feign.hystrix.FallbackFactory;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;
import java.util.Map;
import java.util.Set;

/**
 * @program: quokka-server
 * @description: ${description}
 * @author: sl
 * @create: 2019-06-26 17:54
 **/
@FeignClient(value = "PUNISH",  configuration = FeignConfiguration.class, fallbackFactory = FeignClientPunishFallbackFactory.class)
public interface FeignClientPunish {
    /**
     * 案件指数
     *
     * @return
     */
    @RequestMapping(value = "punish/interface/getRecPunishByDate", method = RequestMethod.GET)
    List<Map<String, Object>> getRecPunishByDate(@RequestBody ScreenReqInfo info);

    /**
     * 案件来源
     *
     * @return
     */
    @RequestMapping(value = "punish/interface/getLegalCaseSource", method = RequestMethod.GET)
    List<Map<String, Object>> getLegalCaseSource(@RequestBody ScreenReqInfo info);
    /**
     * 案件区域分布
     *
     * @param info
     * @return
     */
    @RequestMapping(value = "punish/interface/getLegalCaseRegion", method = RequestMethod.GET)
    List<Map<String, Object>> getLegalCaseRegion(@RequestBody ScreenReqInfo info);

    /**
     * top5
     * @param info
     * @return
     */
    @RequestMapping(value = "punish/interface/getLegalCaseDomain", method = RequestMethod.GET)
    List<Map<String,Object>> getLegalCaseDomain(@RequestBody ScreenReqInfo info);

    /**
     * 首页悬浮栏
     * @param info
     * @return
     */
    @RequestMapping(value = "punish/interface/getLegalCaseGeneral", method = RequestMethod.GET)
    Map<String,Object> getLegalCaseGeneral(@RequestBody ScreenReqInfo info);

    /**
     * 法律法规top5
     * @return
     */
    @RequestMapping(value = "punish/interface/getLawCaseTop5", method = RequestMethod.GET)
    List<Map<String,Object>> getLawCaseTop5(@RequestBody ScreenReqInfo info);

    /**
     * 法律法规top
     * @return
     */
    @RequestMapping(value = "punish/interface/getLawCaseTop", method = RequestMethod.GET)
    List<Map<String,Object>> getLawCaseTop(@RequestBody ScreenReqInfo info);


    /**
     * 法律法规使用
     * @return
     */
    @RequestMapping(value = "punish/interface/getLawUseStat", method = RequestMethod.GET)
    List<Map<String,Object>> getLawUseStat(@RequestBody ScreenReqInfo info);


    /**
     * 根据regionCode查询所有已有违法事实的行政处罚
     * @return
     */
    @RequestMapping(value = "punish/interface/getBasisCodeByRegionCode", method = RequestMethod.GET)
    List<Map<String,Object>> getBasisCodeByRegionCode(@RequestBody ScreenReqInfo info);

    /**
     * 履职情况top5
     * @return
     */
    @RequestMapping(value = "punish/interface/getPerformDomain", method = RequestMethod.GET)
    List<Map<String,Object>> getPerformDomain(@RequestBody ScreenReqInfo info);

    /**
     * 分时间趋势查询行政处罚数量
     * @return
     */
    @RequestMapping(value = "punish/interface/getLegalCaseInfoByDate", method = RequestMethod.GET)
    List<Map<String,Object>> getLegalCaseInfoByDate(@RequestBody ScreenReqInfo info);

    /**
     * top10
     * @return
     */
    @RequestMapping(value = "punish/interface/getLawCaseTopForPerform", method = RequestMethod.GET)
    List<Map<String,Object>> getLawCaseTopForPerform(@RequestBody ScreenReqInfo info);


    /**
     * 行政处罚案由使用
     * @return
     */
    @RequestMapping(value = "punish/interface/getCauseUseStat", method = RequestMethod.GET)
    List<Map<String, Object>> getCauseUseStat(@RequestBody ScreenReqInfo info);

    /**
     * 行政处罚区域分布部门数量
     * @return
     */
    @RequestMapping(value = "punish/interface/getPunishByRegionId", method = RequestMethod.GET)
    List<Map<String,Object>> getPunishByRegionId(ScreenReqInfo info);
}
@Component
class FeignClientPunishFallbackFactory implements FallbackFactory<FeignClientPunish> {
    private static final Logger LOGGER = LoggerFactory.getLogger(FeignClientPunishFallbackFactory.class);

    @Override
    public FeignClientPunish create(final Throwable cause) {
        return new FeignClientPunish() {

            @Override
            public List<Map<String, Object>> getRecPunishByDate(ScreenReqInfo info) {
                return null;
            }

            @Override
            public List<Map<String, Object>> getLegalCaseSource(ScreenReqInfo info) {
                return null;
            }

            @Override
            public List<Map<String, Object>> getLegalCaseRegion(ScreenReqInfo info) {
                return null;
            }

            @Override
            public List<Map<String, Object>> getLegalCaseDomain(ScreenReqInfo info) {
                return null;
            }

            @Override
            public Map<String, Object> getLegalCaseGeneral(ScreenReqInfo info) {
                return null;
            }

            @Override
            public List<Map<String, Object>> getLawCaseTop5(ScreenReqInfo info) {
                return null;
            }

            @Override
            public List<Map<String, Object>> getLawCaseTop(ScreenReqInfo info) {
                return null;
            }

            @Override
            public List<Map<String, Object>> getLawUseStat(ScreenReqInfo info) {
                return null;
            }

            @Override
            public List<Map<String, Object>> getBasisCodeByRegionCode(ScreenReqInfo info) {
                return null;
            }

            @Override
            public List<Map<String, Object>> getPerformDomain(ScreenReqInfo info) {
                return null;
            }

            @Override
            public List<Map<String, Object>> getLegalCaseInfoByDate(ScreenReqInfo info) {
                return null;
            }

            @Override
            public List<Map<String, Object>> getLawCaseTopForPerform(ScreenReqInfo info) {
                return null;
            }

            @Override
            public List<Map<String, Object>> getCauseUseStat(ScreenReqInfo info) {
                return null;
            }

            @Override
            public List<Map<String, Object>> getPunishByRegionId(ScreenReqInfo info) {
                return null;
            }
        };
    }

}
